package com.icinfo.cloud.provider.punish.controller;

import com.icinfo.cloud.provider.common.client.IUserCenterClient;
import com.icinfo.cloud.provider.punish.dto.CheckObjectDetailVo;
import com.icinfo.cloud.provider.punish.dto.CheckObjectInfoBySourceIdDto;
import com.icinfo.framework.common.web.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 检查相关
 */
@RestController
@RequestMapping("/app/punish/usercenter")
public class UserCenterClientController {

    @Resource
    private IUserCenterClient userCenterClient;


    /**
     * 通过检查对象id获取检查对象的相关信息
     *
     * @param dto
     * @return
     */
    @GetMapping("/getCheckObjectInfoBySourceId")
    public Result<CheckObjectDetailVo> getCheckObjectInfoBySourceId(@Validated CheckObjectInfoBySourceIdDto dto) {
        return Result.success(CheckObjectDetailVo.convertByTaskClientVO(userCenterClient.getCheckObjectInfoBySourceId(dto)));
    }

}
